package com.gexiaobao.pigeon.app.model.bean

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize

/**
 * @Author      : hxw
 * @Date        : 2023/3/3 14:45
 * @Describe    :
 */
@Parcelize
class GoodsDetailResponse(

    var id: Int = 0,
    var userId: Int = 0,
    var showPrice: Double = 0.00,
    var soldNum: Int = 0,
    var deses: ArrayList<Deses>? = arrayListOf(),
    var specs: ArrayList<Specs> = arrayListOf(),
    var brandName: String = "",
    var goodName: String = "",
    var goodNo: String = "",
    var imgDescription: String = "",
    var shopGoodTypeId: Int = 0,
    var brandId: Int = 0,
    var goodImg: String = "",
    var minPrice: Double = 0.00,
    var shopGoodTypeChildId: Int = 0,
    var unit: String = "",
    var sort: Int = 0,
    var salePrice: Double = 0.00,
    var maxPrice: Double = 0.00,
    var firstWeightFee: Double = 0.00,
    var imgDescriptions: ArrayList<String> = arrayListOf(),
    var brandLogo: String = "",
    var shopName: String = "",
    var brandType: Int = 0,//1国产2进口
    var shopId: Int = 0,
    var isCollect: Boolean = false,
    var list: ArrayList<CouponList> = arrayListOf(),
    var carousel: ArrayList<String> = arrayListOf(),
    var lowPriceSpecIndex: Int = -1,
    var address: String = "",
    var addressDetail: String = "",
    var collectCnt: Int = 0,//收藏数量
    var goodReviewsPercent: Double = 0.0,//好评率
    var clickCnt: Int = 0,//点击量
    var chargeDesc: String = "",//充值描述
    var isRealName: Boolean = false,//是否实名
    var idCardNo: String = "",
    var idCardName: String = "",
    var hasIdCardPic: String = ""

) : Parcelable {

    /**
     * 数据是否为空
     */
    fun isEmptyDesc() = deses == null || (deses as List<*>).isEmpty()

    /**
     * 数据是否为空
     */
    fun isEmptySpecs() = specs == null || (specs as List<*>).isEmpty()

    fun isEmptyCouponList() = list == null || (list as List<*>).isEmpty()

    @Parcelize
    class CouponList(

        var id: Int = 0,
        var couponName: String = "",
        var money: Double = 0.00,
        var condition: Double = 0.00,
        var effEnd: String = "",//到期时间
        var useTypeLabel: String = ""

    ) : Parcelable

    @Parcelize
    class Deses(

        var id: Int = 0,
        var content: String = "",
        var goodTypeDesName: String = ""

    ) : Parcelable

    @Parcelize
    class Specs(

        var id: Int = 0,
        var specName: String = ""

    ) : Parcelable

}